<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<ul id="ul01">
			<li>苹果</li>
			<li>栗子</li>
			<li>葡萄</li>
			
		</ul>
		<button onclick="del()">删除</button>
		
		<script type="text/javascript">
			function del()
			{
				if(ul01.hasChildNodes())
				{
					ul01.removeChild(ul01.lastChild)
				}
			}
		</script>
	</body>
</html>
